//
//  APIClient.m
//  Castlery
//
//  Created by xie weizhi on 8/8/17.
//  Copyright © 2017 xie weizhi. All rights reserved.
//

#import "APIClient.h"
#import "HTTPManager.h"

@implementation APIClient

+ (void)requestProductListWithParams:(NSDictionary *)params
                             success:(APIClientSuccessBlock)success
                             failure:(APIClientFailureBlock)failure {
    [[HTTPManager sharedManager] requestWithPath:@"products"
                                          params:params
                                          method:GET
                                         success:success
                                         failure:failure];
}

+ (void)requestProductDetailWithProductID:(NSString *)productID
                                  success:(APIClientSuccessBlock)success
                                  failure:(APIClientFailureBlock)failure {
    NSString *path = [NSString stringWithFormat:@"products/%@", productID];
    [[HTTPManager sharedManager] requestWithPath:path
                                          params:nil
                                          method:GET
                                         success:success
                                         failure:failure];
}

@end
